home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Tools / Win95 Secrets / SETUP.Z / MBASSERT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-19  |  1.0 KB  |  27 lines

  1. //==================================
  2. // WIN32WLK - Matt Pietrek 1995
  3. // FILE: MBASSERT.H
  4. //==================================
  5. #ifdef NDEBUG
  6. #define MBassert(exp)((void)0)
  7. #else
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. void __cdecl _MBassert(void *, void *, unsigned);
  12. #ifdef __cplusplus
  13. }
  14. #endif
  15. #define MBassert(exp)(void)( (exp) || (_MBassert(#exp, __FILE__, __LINE__), 0) )
  16. #endif  /* NDEBUG */
  17.  
  18. #define IsSelector( value ) ((((DWORD)value & 0x7) == 0x7) ? 1 : 0)
  19. #define Is16BitGlobalHandle( value ) ((((DWORD)value & 0x6) == 0x6) ? 1 : 0)
  20. #define IsDivisibleBy4( value ) ((((DWORD)value & 0x3) == 0) ? 1 : 0)
  21. #define IsK32HeapHandle( value ) (   IsDivisibleBy4( value ) \
  22.                                      && ((DWORD)value > 0x80000000) \
  23.                                      && ((DWORD)value < 0xC0000000) )
  24. #define IsRing0HeapHandle( value ) ( IsDivisibleBy4( value ) \
  25.                                      && ((DWORD)value > 0xC0000000) )
  26. #define IsHeapStart( value ) ( value && !( (DWORD)value & 0x00000FFF) )
  27.